<template>
<div class="header-title">
        <span>{{title}}</span>
        <div class="help-icon" v-if="hasHelp">
            <router-link :to="help.url" v-for="help in helps" :key="help.id">
                <img :src="'/static/images/'+help.img" />
            </router-link>
        </div>
</div>
</template>
    
<script>
export default {
    name: 'Title',
    data:function(){
        return {	helps:[//主页面显示按钮
						{id:'01',url:'password.html',img:'password_icon.png',title:'修改密码'},
						{id:'02',url:'help.html',img:'help-icon.png',title:'帮助'},
						{id:'03',url:'data-retrieval.html',img:'help-icon01.png',title:'检索'},
						{id:'04',url:'/',img:'help-icon02.png',title:'退出'},
						{id:'05',url:'#',img:'help-icon03.png',title:'关机'}
            ]
            }
    },
    props:{
      hasHelp:{//从父接收参数
          type: Boolean,
          required: true
      },title:{
          type: String,
          required: true
      }
  }
}
</script>
<style scoped>
@import url('../assets/css/index.css');
</style>